use std::error::Error;
use std::process::Command;
///初始化git
pub fn init_git(docs_name: &str, is_skip: &bool) -> Result<(), Box<dyn Error>> {
    if *is_skip {
        return Ok(());
    }
    //初始化git仓库
    Command::new("git")
        .arg("init")
        .current_dir(&docs_name)
        .output()?;
    //添加全部文件
    Command::new("git")
        .arg("add")
        .arg(".")
        .current_dir(&docs_name)
        .output()?;
    //提交
    Command::new("git")
        .arg("commit")
        .arg("-m")
        .arg("initial commit")
        .current_dir(&docs_name)
        .output()?;
    Ok(())
}
